Skip to content

ADFA-4322: Paper-cut: Guide users to enable Display over other apps when blocked by Android restricted settings during onboarding#1391

Merged
Daniel-ADFA merged 2 commits into
stagefrom
ADFA-4322
Jun 25, 2026
Merged

ADFA-4322: Paper-cut: Guide users to enable Display over other apps when blocked by Android restricted settings during onboarding#1391
Daniel-ADFA merged 2 commits into
stagefrom
ADFA-4322

Conversation

@Daniel-ADFA

Copy link
Copy Markdown
Contributor
Screen_recording_20260615_192720.mp4

…hen blocked by Android restricted settings during onboarding
@Daniel-ADFA Daniel-ADFA requested a review from a team June 15, 2026 17:28
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f5afbf63-39c5-430e-a9e2-2006d5f17ad7

📥 Commits

Reviewing files that changed from the base of the PR and between d6691b1 and 17a8f0b.

📒 Files selected for processing (1)
  • resources/src/main/res/values/strings.xml
🚧 Files skipped from review as they are similar to previous changes (1)
  • resources/src/main/res/values/strings.xml

📝 Walkthrough

Release Notes

  • Onboarding guidance for restricted “Display over other apps”: When Android blocks enabling the overlay permission via restricted settings, users are shown an instructional “Enable restricted settings” dialog instead of an immediate error.
  • Step-by-step App Info instructions: Introduced OverlayPermissionGuide.showRestrictedSettingsDialog(context) to display localized, ordered steps and a button to open the app’s App Info screen so users can manually enable the restricted overlay toggle.
  • Lifecycle-aware follow-up after permission request: Updated PermissionsFragment to only run the post-overlay-permission UI flow when the overlay grant request was initiated, and to show the restricted-settings dialog when the fragment is resumed and overlay permission is still not granted.
  • New user-facing copy: Added strings and an instruction array for the restricted-settings dialog and its “Open App info” action.

Risks & Best Practices Violations

  • ⚠️ Shared mutable state: awaitingOverlayGrantResult is stored in PermissionsFragment’s companion object, making it shared across fragment instances and potentially problematic if multiple instances exist or recreate during onboarding.
  • ⚠️ Runtime Activity type check for intent flags: Uses context !is Activity to decide whether to add FLAG_ACTIVITY_NEW_TASK; works, but relies on runtime type behavior rather than more explicit context/activity handling.

Walkthrough

Adds a new OverlayPermissionGuide dialog flow for restricted overlay settings. PermissionsFragment now waits for the overlay result, then shows the guide on resume when overlay permission remains unavailable. New strings provide the dialog copy and setup steps.

Changes

Overlay Permission Restricted Settings Guide

Layer / File(s) Summary
String resources for restricted overlay dialog
resources/src/main/res/values/strings.xml
Adds the restricted-settings dialog title, message, app-info action label, and ordered overlay enable steps.
OverlayPermissionGuide utility object
app/src/main/java/com/itsaky/androidide/utils/OverlayPermissionGuide.kt
Adds a dialog helper that builds the instructional message, shows the material dialog, opens app info, and logs plus flashes an error if app-info settings cannot be opened.
PermissionsFragment post-overlay flow rewiring
app/src/main/java/com/itsaky/androidide/fragments/onboarding/PermissionsFragment.kt
Moves awaitingOverlayGrantResult to companion scope, adds lifecycle-aware handling, and replaces the immediate settings redirect with OverlayPermissionGuide.showRestrictedSettingsDialog(...) when overlay permission is still denied.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • jatezzz
  • itsaky-adfa
  • dara-abijo-adfa

Poem

🐇 Hop hop, the overlay tale is new,
A guide with steps and buttons too.
If Android says “no,” the rabbit says “go,”
To App Info’s door, where permissions grow.
A tiny bounce, a helpful glow ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description is only an attachment link, so it does not meaningfully describe the changeset. Add a short textual summary of the onboarding and overlay-permission changes.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: onboarding guidance for Android's restricted overlay permission.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ADFA-4322

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jatezzz jatezzz self-requested a review June 23, 2026 15:15
@Daniel-ADFA Daniel-ADFA merged commit c1fdf95 into stage Jun 25, 2026
2 checks passed
@Daniel-ADFA Daniel-ADFA deleted the ADFA-4322 branch June 25, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants